import random


""" """ """ """
NUM_TRIALS = 100
PRISONER_CHOICE = 50
""" """ """ """


prisoner_id = [_ for _ in range(0, 100)]
box = [_ for _ in range(0, 100)]
random.shuffle(box)

flag = 1
correct = 0
error = 0
# while True:
for s in range(0, NUM_TRIALS):
    random.shuffle(box)
    flag = 1
    for i, a in enumerate(prisoner_id):
        start = i
        remain_choice = PRISONER_CHOICE

        while box[start] != a and remain_choice != 0:
            start = box[start]
            remain_choice -= 1

        if remain_choice == 0:  # failed
            flag = 0
            break

    if flag == 0:
        error += 1
    else:
        correct += 1

print(correct, error)
